home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / initramfs-tools / hooks / udev < prev    next >
Encoding:
Text File  |  2010-12-12  |  2.0 KB  |  73 lines

  1. #!/bin/sh -e
  2.  
  3. PREREQS=""
  4.  
  5. prereqs() { echo "$PREREQS"; }
  6.  
  7. case "$1" in
  8.     prereqs)
  9.     prereqs
  10.     exit 0
  11.     ;;
  12. esac
  13.  
  14. root_over_the_network() {
  15.   if   egrep -q '^/dev/(nbd|nd[a-z]|etherd/e)[^[:space:]]+[[:space:]]+/[[:space:]]' /etc/fstab; then
  16.     return 0
  17.   elif egrep -q '^[^[:space:]#]+[[:space:]]+/[[:space:]]+nfs[234]?[[:space:]]' /etc/fstab; then
  18.     return 0
  19.   fi
  20.   return 1 # false
  21. }
  22.  
  23. . /usr/share/initramfs-tools/hook-functions
  24.  
  25. # udevd uses unix domain sockets for communication
  26. force_load unix
  27.  
  28. copy_exec /sbin/udevd      /sbin
  29. copy_exec /sbin/udevadm    /sbin
  30.  
  31. mkdir -p $DESTDIR/etc/udev
  32. cp -p /etc/udev/udev.conf $DESTDIR/etc/udev/
  33.  
  34. mkdir -p $DESTDIR/lib/udev/rules.d/
  35. for rules in 50-udev-default.rules 60-persistent-storage.rules \
  36.     80-drivers.rules 91-permissions.rules \
  37.     64-md-raid.rules 60-persistent-storage-lvm.rules \
  38.     55-dm.rules 60-persistent-storage-dm.rules; do
  39.   if   [ -e /etc/udev/rules.d/$rules ]; then
  40.     cp -p /etc/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
  41.   elif [ -e /lib/udev/rules.d/$rules ]; then
  42.     cp -p /lib/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
  43.   fi
  44. done
  45.  
  46. # try to autodetect the value of this configuration option
  47. if [ -z "$NEED_PERSISTENT_NET" ] && root_over_the_network; then
  48.   NEED_PERSISTENT_NET='yes'
  49. fi
  50.  
  51. # Copy the rules for persistent network interface names for the benefit of
  52. # systems which need to boot over the network. If this is enabled then the
  53. # initramfs must be rebuilt every time a new network interface is added.
  54. # See #414287 for details.
  55. case "$NEED_PERSISTENT_NET" in
  56. YES|yes|Yes|Y|y)
  57.   if [ -e /etc/udev/rules.d/70-persistent-net.rules ]; then
  58.     cp -p /etc/udev/rules.d/70-persistent-net.rules $DESTDIR/lib/udev/rules.d/
  59.   fi
  60.   ;;
  61. esac
  62.  
  63. cp /lib/udev/hotplug.functions $DESTDIR/lib/udev/
  64. for program in firmware.agent ata_id edd_id path_id scsi_id usb_id; do
  65.   copy_exec /lib/udev/$program /lib/udev
  66. done
  67. copy_exec /sbin/blkid /sbin
  68.  
  69. if [ -x /lib/udev/vio_type ]; then
  70.   copy_exec /lib/udev/vio_type /lib/udev
  71. fi
  72.  
  73.